﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Web.Mail;

namespace Com.Framework.Email
{
	public class WebMail
	{
		public void Send(string fromAddr, string ToAddr, string subject, string content)
		{
			MailMessage mail = new MailMessage();

			mail.From = fromAddr;
			mail.To = ToAddr;
			mail.Subject = subject;
			mail.Body = content;
			mail.BodyFormat = MailFormat.Html;

			mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
			mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "manager@gurunaru2.cafe24.com"); //set your username here
			mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "coffine9677"); //set your password here

			SmtpMail.SmtpServer = "mw-002.cafe24.com"; //your real server goes here 
			SmtpMail.Send(mail); 

		}
	}
}
